In chaos theory, the Ikeda map is a discrete-time dynamical system that produces a strange attractor. It was introduced in 1979 by the physicist Kensuke Ikeda as a model for the behavior of light within a nonlinear optical resonator. The map demonstrates how a simple set of rules can lead to complex, chaotic behavior through a process of repeated rotation, scaling, and translation—a "stretch and fold" operation common in chaotic systems.
The map is defined by an iterative function on the complex plane. For a given complex number , the next value is calculated as:Here, represents the electric field in the resonator at step . The parameters and relate to the external laser light and the phase of the system, while (where ) is a dissipation parameter representing energy loss in the resonator.
A commonly studied real-valued version of the map is given by the two-dimensional equations:where is a parameter andFor values of the parameter , this system exhibits chaotic behavior, generating the characteristic fractal attractor shown in the article's images.
x = randn(1, P) * 10; % the random starting points y = randn(1, P) * 10;
for n = 1:P,
X = compute_ikeda_trajectory(u, x(n), y(n), N);
switch option case 'trajectory' % plot the trajectories of a bunch of points plot_ikeda_trajectory(X); hold on;
case 'limit' plot_limit(X, Nlimit); hold on;
otherwise disp('Not implemented'); endend
axis tight; axis equal text(- 25, - 15, 'u); text(- 25, - 18, 'N); end
% Plot the last n points of the curve - to see end point or limit cycle function plot_limit(X, n) plot(X(end - n:end, 1), X(end - n:end, 2), 'ko'); end
% Plot the whole trajectory function plot_ikeda_trajectory(X) plot(X(:, 1), X(:, 2), 'k'); % hold on; plot(X(1,1), X(1,2), 'bo', 'markerfacecolor', 'g'); hold off end
% u is the ikeda parameter % x,y is the starting point % N is the number of iterations function X = compute_ikeda_trajectory(u, x, y, N) X = zeros(N, 2); X(1, :) = x;
for n = 2:N
t = 0.4 - 6 / (1 + x ^ 2 + y ^ 2); x1 = 1 + u * (x * cos(t) - y * sin(t)); y1 = u * (x * sin(t) + y * cos(t)); x = x1; y = y1;
X(n, :) = [x y];end end
import matplotlib.pyplot as plt import numpy as np
def main(u: float, points=200, iterations=1000, nlim=20, limit=False, title=True):
""" Args: u:float ikeda parameter points:int number of starting points iterations:int number of iterations nlim:int plot these many last points for 'limit' option. Will plot all points if set to zero limit:bool plot the last few iterations of random starting points if True. Else Plot trajectories. title:[str, NoneType] display the name of the plot if the value is affirmative """
x = 10 * np.random.randn(points, 1) y = 10 * np.random.randn(points, 1)
for n in range(points): X = compute_ikeda_trajectory(u, x[n][0], y[n][0], iterations)
if limit: plot_limit(X, nlim) tx, ty = 2.5, -1.8
else: plot_ikeda_trajectory(X) tx, ty = -30, -26
plt.title(f"Ikeda Map ({u=:.2g}, {iterations=})") if title else None return plt
def compute_ikeda_trajectory(u: float, x: float, y: float, N: int):
"""Calculate a full trajectory
Args: u - is the ikeda parameter x, y - coordinates of the starting point N - the number of iterations
Returns: An array. """ X = np.zeros((N, 2))
for n in range(N): X[n] = np.array((x, y))
t = 0.4 - 6 / (1 + x ** 2 + y ** 2) x1 = 1 + u * (x * math.cos(t) - y * math.sin(t)) y1 = u * (x * math.sin(t) + y * math.cos(t))
x = x1 y = y1
return X
def plot_limit(X, n: int) -> None:
""" Plot the last n points of the curve - to see end point or limit cycle
Args: X: np.array trajectory of an associated starting-point n: int number of "last" points to plot """ plt.plot(X[-n:, 0], X[-n:, 1], 'ko')
def plot_ikeda_trajectory(X) -> None:
""" Plot the whole trajectory
Args: X: np.array trajectory of an associated starting-point """ plt.plot(X[:,0], X[:, 1], "k")
if __name__ == "__main__":
main(0.9, limit=True, nlim=0).show()
|
|